package com.songlanyun.modules.notifytemp.controller.api;

import com.alibaba.fastjson.JSONObject;
import com.songlanyun.common.enums.WxConstant;
import com.songlanyun.common.exception.RRException;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.common.validator.ValidatorUtils;
import com.songlanyun.modules.notifytemp.entity.NotifyTempEntity;
import com.songlanyun.modules.notifytemp.model.dto.WxNotifyDTO;
import com.songlanyun.modules.notifytemp.service.NotifyTempService;
import com.songlanyun.modules.rabbitmq.MqConstant;
import com.songlanyun.modules.rabbitmq.service.SendMsgService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
 * 微信消息模板表
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2020-11-10 14:22:52
 */
@RestController
@RequestMapping("api/config/notifytemp")
public class NotifyTempApiController extends AbstractController {
    @Autowired
    private NotifyTempService notifyTempService;
    @Resource
    private SendMsgService sendMsgService;



    /**
     * 根据type获取模板
     */
    @GetMapping("/getIdByType/{type}")
//    @RequiresPermissions("config:notifyTemp:info")
    public R info(@PathVariable("type") Integer type) {
        NotifyTempEntity notifyTemp = notifyTempService.getIdByType(type);

        return R.ok().put("data", notifyTemp);
    }


}
